from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from thoughts import views
from django.template import RequestContext


urlpatterns = patterns('',
       url(r'^create/$',
       view = (login_required(views.create)),
       name = 'thought_create'
   ),
   url(r'^references/$', 
       login_required(views.references_list),
       name ='thought_refs'
   ),
   url(r'^era/$', 
       login_required(views.era),
       name='thought_era'
   ),
   url(r'^archive/$', 
       login_required(views.archive),
       name='thought_archive'
   ),
   url(
       r'^toggle-witnessing/(?P<thought_id>\d+)/$', 
       login_required(views.toggle_wintnessing), 
       name = 'thought_tgwitness'
   ), 
   url(
       r'^view-notes/(?P<thought_id>\d+)/$', 
       login_required(views.view_notes), 
       name = 'thought_vnote'
   ), 
   url(
       r'^attach-note/(?P<thought_id>\d+)/(?P<note_id>\d+)/(?P<note_type>\w+)/$', 
       login_required(views.attach_note), 
       name = 'thought_atnote'
   ), 
   url(
       r'^unattach-note/(?P<thought_id>\d+)/(?P<note_id>\d+)/(?P<note_type>\w+)/$', 
       login_required(views.unattach_note), 
       name = 'thought_unatnote'
   ), 
   url(
       r'^publish-note/(?P<thought_id>\d+)/$', 
       login_required(views.toggle_publish), 
       name = 'thought_publish'
   ),
   url(
       r'^update_thought/(?P<thought_id>\d+)/(?P<dontvalidate>\w+)/$', 
       login_required(views.update_thought), 
       name = 'thought_update'
   ),
    
)
